﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EPS.DataAccess;
using EPS.Contracts;

namespace EPS.Business
{
    public class TemplateService : ITemplate
    {
        private CommonService _commonService = null;

        public TemplateService()
        {
            _commonService = new CommonService();
        }

        public void Insert(EPS.Contracts.Template template)
        {
            _commonService.InsertEntity(template);
        }

        public void Update(Template template)
        {
            _commonService.UpdateEntity<Template>(template);
        }

        public Template GetById(string Keyid)
        {
            return _commonService.GetEntity<Template>(p => p.Keyid == Keyid);
        }

        public List< Template> GetBySql(string sql)
        {
            return _commonService.GetBySql<Template>(sql);
        }

        public void DelById(string Keyid)
        {
            _commonService.DeleteEntity<Template>(p => p.Keyid == Keyid);
        }
    }
}
